package com.itbbfx.service.pharmacymanager.impl;

import com.itbbfx.entity.*;
import com.itbbfx.mapper.DrugdictionaryMapper;
import com.itbbfx.service.pharmacymanager.DrugdictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class DrugdictionaryServiceImpl implements DrugdictionaryService {
    @Autowired
    private DrugdictionaryMapper drugdictionaryMapper;

    @Override
    public List<Drugdictionary> selectdgty(Drugdictionary sdrugdictionary) {
        return drugdictionaryMapper.selectdgty(sdrugdictionary);
    }

    @Override
    public int selnumber(String drugstoreName,Integer warehouseId) {
        Map<String,Object> map = new HashMap<>();
        map.put("drugstoreName",drugstoreName);
        map.put("warehouseId",warehouseId);
        map.put("date",new Date());
        return drugdictionaryMapper.selnumber(map);
    }

    @Override
    public int addSdrugdictionary(Drugdictionary sdrugdictionary) {
        return drugdictionaryMapper.addSdrugdictionary(sdrugdictionary);
    }

    @Override
    public int editSdrugdictionary(Drugdictionary sdrugdictionary) {
        return drugdictionaryMapper.editSdrugdictionary(sdrugdictionary);
    }

    @Override
    public int deleteSdrugdictionary(Integer drugId) {
        return drugdictionaryMapper.deleteSdrugdictionary(drugId);
    }

    @Override
    public List<Unit> findAllUnit() {
        return drugdictionaryMapper.findAllUnit();
    }

    @Override
    public List<Area> findAllArea() {
        return drugdictionaryMapper.findAllArea();
    }

    @Override
    public List<Type> findAllType() {
        return drugdictionaryMapper.findAllType();
    }

    @Override
    public int count(Drugdictionary sdrugdictionary) {
        return drugdictionaryMapper.count(sdrugdictionary);
    }
}